import { pagify, MyPage, wxp } from 'base/'

@pagify()
export default class extends MyPage {
  data = {
    categoryList: [
      { cid: 1, name: '烘焙' },
      { cid: 2, name: '下午茶' },
      { cid: 3, name: '大鱼大肉' },
      { cid: 4, name: '乳酪蛋糕' },
      { cid: 5, name: '曲奇' },
      { cid: 6, name: '冰淇淋' },
      { cid: 7, name: '烘焙' },
      { cid: 8, name: '烘焙' },
      { cid: 9, name: '烘焙' },
      { cid: 10, name: '烘焙' },
      { cid: 11, name: '烘焙' },
      { cid: 12, name: '烘焙' },
      { cid: 13, name: '烘焙' },
      { cid: 14, name: '烘焙' },
      { cid: 15, name: '烘焙' },
      { cid: 16, name: '烘焙' },
      { cid: 17, name: '烘焙' },
      { cid: 18, name: '烘焙' },
      { cid: 19, name: '烘焙' },
      { cid: 20, name: '烘焙' },
      { cid: 21, name: '烘焙' },
      { cid: 22, name: '烘焙' },
    ],
    goodList: [
      {
        gid: 1,
        img: 'https://picsum.photos/200/300/?random',
        price: 20,
        title: '商品',
        desc: '商品描述商品描述商品描述商品描述',
        status: '在售'
      },
      {
        gid: 1,
        img: 'https://picsum.photos/200/300/?random',
        price: 20,
        title: '商品',
        desc: '商品描述商品描述商品描述商品描述',
        status: '在售'
      },
      {
        gid: 2,
        img: 'https://picsum.photos/200/300/?random',
        price: 20,
        title: '商品',
        desc: '商品描述商品描述商品描述商品描述',
        status: '在售'
      },
      {
        gid: 3,
        img: 'https://picsum.photos/200/300/?random',
        price: 20,
        title: '商品',
        desc: '商品描述商品描述商品描述商品描述',
        status: '在售'
      },
      {
        gid: 4,
        img: 'https://picsum.photos/200/300/?random',
        price: 20,
        title: '商品',
        desc: '商品描述商品描述商品描述商品描述',
        status: '在售'
      },
      {
        gid: 5,
        img: 'https://picsum.photos/200/300/?random',
        price: 20,
        title: '商品',
        desc: '商品描述商品描述商品描述商品描述',
        status: '在售'
      },
      {
        gid: 6,
        img: 'https://picsum.photos/200/300/?random',
        price: 20,
        title: '商品',
        desc: '商品描述商品描述商品描述商品描述',
        status: '在售'
      },
      {
        gid: 7,
        img: 'https://picsum.photos/200/300/?random',
        price: 20,
        title: '商品',
        desc: '商品描述商品描述商品描述商品描述',
        status: '在售'
      },
      {
        gid: 8,
        img: 'https://picsum.photos/200/300/?random',
        price: 20,
        title: '商品',
        desc: '商品描述商品描述商品描述商品描述',
        status: '在售'
      },
      {
        gid: 9,
        img: 'https://picsum.photos/200/300/?random',
        price: 20,
        title: '商品',
        desc: '商品描述商品描述商品描述商品描述',
        status: '在售'
      },
      {
        gid: 10,
        img: 'https://picsum.photos/200/300/?random',
        price: 20,
        title: '商品',
        desc: '商品描述商品描述商品描述商品描述',
        status: '在售'
      },
      {
        gid: 11,
        img: 'https://picsum.photos/200/300/?random',
        price: 20,
        title: '商品',
        desc: '商品描述商品描述商品描述商品描述',
        status: '在售'
      }
    ],
    currentCategory: 1,
  }

  async onLoad(options: any) {
    console.log(await wxp.getUserInfo())
  }

  switchCategory(e: any) {
    const { cid } = e.currentTarget.dataset
    this.setDataSmart({ currentCategory: cid })
  }
}
